<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>

    <div id="app">
    <h1 v-text="sum"></h1>
        <input type="text" v-model="n1">+
        <input type="text" v-model="n2">=
        <input type="text" v-model="sum">
    </div>

<script>
    var app=new Vue({
        el:'#app',
        computed:{
            sum () {
                return this.n1*1+this.n2*1
            }
        },
        data:{
            n1:1,
            n2:2

        }
    });

</script>
</body>
</html>